<pre>
<?php

	print "Authenticate result: " . auth_user($_GET['u'],$_GET['p']);

	function auth_user($u,$p) {		
		// set URL and other appropriate options
		$curl = curl_init("https://secure.uconn.edu/transportation/login/success.html");
		curl_setopt($curl,CURLOPT_USERPWD,$u . ":" . $p);
		curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
		curl_setopt($curl,CURLOPT_FOLLOWLOCATION,true);
		
		$curl_result = curl_exec($curl);
	
		//verify that the curl command worked.
		if($curl_result === false) {
			die("Oh no... Curl said " . curl_errno($curl) . ": " . curl_error($curl));
		} else {
			$output .= "Curl Transfer was successful.<br />\n";
		} 
		
		$data = curl_getinfo($curl);
		print_r($data);

		if(!isset($data['http_code'])) die("`http_code` value no longer set in CURL");
		
		
		//verify the authentication worked
		if($data['http_code'] == 200) { 
			print "Congrats, you've logged in!";
		} else {
			die("Oh no... Curl returned a " . $data['http_code'] . " error.");
		}
		//otherwise, i think it worked... return true ;)
		if(!isset($data['hello'])) die("`hello` value no longer set in CURL");

		return true;
	}
?>

</pre>